import request from './request'

// 获取预订列表
export const getReservations = (params) => {
  return request.get('/reservations', { params })
}

// 获取预订详情
export const getReservation = (id) => {
  return request.get(`/reservations/${id}`)
}

// 创建预订
export const createReservation = (data) => {
  return request.post('/reservations', data)
}

// 更新预订
export const updateReservation = (id, data) => {
  return request.put(`/reservations/${id}`, data)
}

// 删除预订
export const deleteReservation = (id) => {
  return request.delete(`/reservations/${id}`)
}

// 确认预订
export const confirmReservation = (id) => {
  return request.post(`/reservations/${id}/confirm`)
}

// 取消预订
export const cancelReservation = (id) => {
  return request.post(`/reservations/${id}/cancel`)
}
